using JGSY.CMS.LowCode.Platform.Application.DTOs;
using JGSY.CMS.LowCode.Platform.Application.Interfaces;

namespace JGSY.CMS.LowCode.Platform.Application.Extensions
{
    /// <summary>
    /// 租户DTO转换扩展
    /// </summary>
    public static class TenantDtoExtensions
    {
        /// <summary>
        /// 转换为创建租户请求
        /// </summary>
        public static CreateTenantRequest ToCreateRequest(this CreateTenantDto dto)
        {
            return new CreateTenantRequest
            {
                TenantId = dto.TenantId,
                Name = dto.Name,
                DisplayName = dto.DisplayName,
                Description = dto.Description
            };
        }

        /// <summary>
        /// 转换为更新租户请求
        /// </summary>
        public static UpdateTenantRequest ToUpdateRequest(this UpdateTenantDto dto)
        {
            return new UpdateTenantRequest
            {
                Name = dto.Name,
                DisplayName = dto.DisplayName,
                Description = dto.Description
            };
        }
    }
}
